<?php

$customer_id = $_SESSION['userid'];

function isLoggedIn()
{
    if(isset($_SESSION['valid']) && $_SESSION['userid'])
        return true;
    return false;
}

//if the user has not logged in
if(!isLoggedIn())
{
    header('Location: index.php?error=No Account');
    die();
}
//page content follows
?>